home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / util / wb / ToolManagerBin.lha / ToolManager / Install / Install_ToolManager < prev   
Text File  |  1998-06-01  |  25KB  |  656 lines

  1. ;
  2. ; Install_ToolManager V3.1
  3. ;
  4. ; ToolManager Installer script
  5. ;
  6. ; Copyright (C) 1990-98 Stefan Becker
  7. ;
  8. ; This source code is for educational purposes only. You may study it
  9. ; and copy ideas or algorithms from it for your own projects. It is
  10. ; not allowed to use any of the source codes (in full or in parts)
  11. ; in other programs. Especially it is not allowed to create variants
  12. ; of ToolManager or ToolManager-like programs from this source code.
  13. ;
  14. ;-----------------------------------------------------------------------------
  15. ;
  16. ; User-defined procedures
  17. ;
  18. ;-----------------------------------------------------------------------------
  19. ;
  20. ; Cleanup routine
  21. (procedure P_Cleanup
  22.   (
  23.     (delete "ENV:TM_locale_#?" (safe))
  24.     (delete "ENV:TM_language#?" (safe))
  25.   )
  26. )
  27. ;-----------------------------------------------------------------------------
  28. ;
  29. ; Get localized text
  30. ;
  31. ; Inputs: variable (string)  Environment variable
  32. ;         default  (string)  Default english text
  33. ;
  34. (procedure P_GetText #arg_GT_variable #arg_GT_default
  35.   (
  36.     (set #local_GT_var (cat "TM_locale_" #arg_GT_variable))
  37.     (if (exists (cat "ENV:" #local_GT_var))
  38.       (getenv #local_GT_var)
  39.       (cat #arg_GT_default)
  40.     )
  41.   )
  42. )
  43. ;
  44. ;-----------------------------------------------------------------------------
  45. ;
  46. ; Initialize installer texts
  47. ;
  48. (procedure P_InitLocale
  49.   (
  50.     ; Set english default texts first
  51.     (set #text_welcome           (cat "\n"
  52.                                       "Welcome to ToolManager 3.1\n\n"
  53.                                       "This installation routine will install the ToolManager on your system.\n\n"
  54.                                       "ToolManager 2.x installations will be updated for the new version.\n\n"
  55.                                       "For new users there is also a small demo at the end of the installation.\n\n"
  56.                                       "You have choosen english as your default language."
  57.                                  ))
  58.     (set #text_old_toolmanager   "Do you have ToolManager running?\n\nIf the starter for the old ToolManager is not installed in SYS:WBStartup then stop ToolManager now and answer with 'No'.")
  59.     (set #help_old_toolmanager   (cat "Answer yes if ToolManager is currently running on your system. "
  60.                                       "ToolManager must not be running during the installation! "
  61.                                       "It will be automatically stopped if you answer with yes."
  62.                                  ))
  63.     (set #text_stop_old          "Stopping old ToolManager...")
  64.     (set #text_install_library   "Install toolmanager.library")
  65.     (set #help_install_library   "The library is the most important part of ToolManager. It has to be installed in order to use ToolManager.")
  66.     (set #text_install_prefs     "Install the preferences editor")
  67.     (set #help_install_prefs     "The preferences editor allows you to configure ToolManager.\n\nNOTE: MUI 3.6 (or better) is required to run the preferences editor!")
  68.     (set #text_install_starter   "Install the ToolManager starter")
  69.     (set #help_install_starter   "If the starter is installed in SYS:WBStartup then ToolManager will be started automatically during the startup of your system.")
  70.     (set #text_install           "Install ")
  71.     (set #text_ask_languages     "Install languages?")
  72.     (set #help_ask_languages     "Choose yes if you want to install the translations for the ToolManager texts.")
  73.     (set #text_install_languages "Install languages")
  74.     (set #help_install_languages "Choose the languages which you want to install.")
  75.     (set #help_install_langdir   "Choose the directory where the language catalogs are located on your system. Each language has a subdirectory in this directory.")
  76.     (set #text_ask_guides        "Install AmigaGuide documentation?")
  77.     (set #help_ask_guides        "Choose yes if you want to install the ToolManager documentation in AmigaGuide format.")
  78.     (set #text_install_guides    "Install AmigaGuide documentation")
  79.     (set #help_install_guides    "Choose the languages for which you want to install the AmigaGuide documentation.")
  80.     (set #help_install_guidedir  "Choose the directory where the AmigaGuide documentations are located on your system. Each language has a subdirectory in this directory.")
  81.     (set #text_read_guides       "Do you want to read the documentation now?")
  82.     (set #help_read_guides       "Choose yes to read the documentation in AmigaGuide format in your preferred language.")
  83.     (set #text_reading_guides    "Reading documentation...")
  84.     (set #text_ask_extras        "Install additional packages?")
  85.     (set #help_ask_extras        "These additional packages are required by ToolManager. You may skip these part if the files are already installed on your system.")
  86.     (set #text_extras_stefanb    "Install dospath.library and wbstart.library")
  87.     (set #help_extras_stefanb    "Installs libraries from the DOSPath and WBStart packages.\n\nCopyright (C) Stefan Becker")
  88.     (set #text_extras_kmel       "Install Pop* MUI custom classes")
  89.     (set #help_extras_kmel       "Installs additional MUI custom classes.\n\nCopyright (C) Klaus Melchior")
  90.     (set #text_check_header      "The following required library is missing on your system:\n\nFile name: ")
  91.     (set #text_check_version     "\n\nRequired version: ")
  92.     (set #text_check_footer      "\n\nPlease read the documentation again, fetch the missing archive from the ToolManager distribution, e.g. the Extras archive, and re-run the installation.")
  93.     (set #text_convert           "Convert old configuration?")
  94.     (set #help_convert           "The configuration file format has changed for ToolManager 3.x. A program will convert your old configuration to the new format.")
  95.     (set #text_converting        "Converting configuration...")
  96.     (set #text_disclaimer        "Showing disclaimer...")
  97.     (set #text_start_new         "Start new ToolManager?")
  98.     (set #help_start_new         "Choose yes if you want to try the new ToolManager now.")
  99.     (set #text_starting_new      "Starting new ToolManager...")
  100.     (set #text_start_demo        "Start ToolManager demonstration?")
  101.     (set #help_start_demo        "Choose yes if you want to try the ToolManager demo now.")
  102.     (set #text_starting_demo     "Starting ToolManager demo...")
  103.     (set #text_stop_demo         "Stop ToolManager demo...")
  104.     (set #text_complete          "\n\nToolManager 3.1 is now installed on your system.\n\nHave fun!")
  105.     (set #text_installer         "Installer 43.3 or better required!")
  106.  
  107.     ; Localize texts If selected language is not "english"
  108.     (if (<> @language "english")
  109.       (
  110.         ; Copy locale texts to environment variables
  111.         (execute @language (safe))
  112.  
  113.         ; Get texts
  114.         (set #text_welcome           (P_GetText "text_welcome"           #text_welcome))
  115.         (set #text_old_toolmanager   (P_GetText "text_old_toolmanager"   #text_old_toolmanager))
  116.         (set #help_old_toolmanager   (P_GetText "help_old_toolmanager"   #help_old_toolmanager))
  117.         (set #text_stop_old          (P_GetText "text_stop_old"          #text_stop_old))
  118.         (set #text_install_library   (P_GetText "text_install_library"   #text_install_library))
  119.         (set #help_install_library   (P_GetText "help_install_library"   #help_install_library))
  120.         (set #text_install_prefs     (P_GetText "text_install_prefs"     #text_install_prefs))
  121.         (set #help_install_prefs     (P_GetText "help_install_prefs"     #help_install_prefs))
  122.         (set #text_install_starter   (P_GetText "text_install_starter"   #text_install_starter))
  123.         (set #help_install_starter   (P_GetText "help_install_starter"   #help_install_starter))
  124.         (set #text_install           (P_GetText "text_install"           #text_install))
  125.         (set #text_ask_languages     (P_GetText "text_ask_languages"     #text_ask_languages))
  126.         (set #help_ask_languages     (P_GetText "help_ask_languages"     #help_ask_languages))
  127.         (set #text_install_languages (P_GetText "text_install_languages" #text_install_languages))
  128.         (set #help_install_languages (P_GetText "help_install_languages" #help_install_languages))
  129.         (set #help_install_langdir   (P_GetText "help_install_langdir"   #help_install_langdir))
  130.         (set #text_ask_guides        (P_GetText "text_ask_guides"        #text_ask_guides))
  131.         (set #help_ask_guides        (P_GetText "help_ask_guides"        #help_ask_guides))
  132.         (set #text_install_guides    (P_GetText "text_install_guides"    #text_install_guides))
  133.         (set #help_install_guides    (P_GetText "help_install_guides"    #help_install_guides))
  134.         (set #help_install_guidedir  (P_GetText "help_install_guidedir"  #help_install_guidedir))
  135.         (set #text_read_guides       (P_GetText "text_read_guides"       #text_read_guides))
  136.         (set #help_read_guides       (P_GetText "help_read_guides"       #help_read_guides))
  137.         (set #text_reading_guides    (P_GetText "text_reading_guides"    #text_reading_guides))
  138.         (set #text_ask_extras        (P_GetText "text_ask_extras"        #text_ask_extrass))
  139.         (set #help_ask_extras        (P_GetText "help_ask_extras"        #help_ask_extrass))
  140.         (set #text_extras_stefanb    (P_GetText "text_extras_stefanb"    #text_extras_stefanb))
  141.         (set #help_extras_stefanb    (P_GetText "help_extras_stefanb"    #help_extras_stefanb))
  142.         (set #text_extras_kmel       (P_GetText "text_extras_kmel"       #text_extras_kmel))
  143.         (set #help_extras_kmel       (P_GetText "help_extras_kmel"       #help_extras_kmel))
  144.         (set #text_check_header      (P_GetText "text_check_header"      #text_check_header))
  145.         (set #text_check_version     (P_GetText "text_check_version"     #text_check_version))
  146.         (set #text_check_footer      (P_GetText "text_check_footer"      #text_check_footer))
  147.         (set #text_convert           (P_GetText "text_convert"           #text_convert))
  148.         (set #help_convert           (P_GetText "help_convert"           #help_convert))
  149.         (set #text_converting        (P_GetText "text_converting"        #text_converting))
  150.         (set #text_disclaimer        (P_GetText "text_disclaimer"        #text_disclaimer))
  151.         (set #text_start_new         (P_GetText "text_start_new"         #text_start_new))
  152.         (set #help_start_new         (P_GetText "help_start_new"         #help_start_new))
  153.         (set #text_starting_new      (P_GetText "text_starting_new"      #text_starting_new))
  154.         (set #text_start_demo        (P_GetText "text_start_demo"        #text_start_demo))
  155.         (set #help_start_demo        (P_GetText "help_start_demo"        #help_start_demo))
  156.         (set #text_starting_demo     (P_GetText "text_starting_demo"     #text_starting_demo))
  157.         (set #text_stop_demo         (P_GetText "text_stop_demo"         #text_stop_demo))
  158.         (set #text_complete          (P_GetText "text_complete"          #text_complete))
  159.         (set #text_installer         (P_GetText "text_installer"         #text_installer))
  160.  
  161.         ; Delete environment variables
  162.         (delete "ENV:TM_locale_#?" (safe))
  163.       )
  164.     )
  165.   )
  166. )
  167. ;-----------------------------------------------------------------------------
  168. ;
  169. ; Install language dependent files
  170. ;
  171. ; Inputs: src  (string)   Source path
  172. ;         dest (string)   Destination path
  173. ;         lang (string)   language
  174. ;         type (integer)  type (0 language, 1 guides)
  175. ;
  176. (procedure P_InstallLanguage #arg_IL_src #arg_IL_dest #arg_IL_lang #arg_IL_type
  177.   (
  178.     (set #local_IL_source      (tackon #arg_IL_src  #arg_IL_lang))
  179.     (set #local_IL_destination (tackon #arg_IL_dest #arg_IL_lang))
  180.  
  181.     (debug "Source" #local_IL_source "Dest" #local_IL_destination)
  182.  
  183.     (if (= #arg_IL_type 0)
  184.       (
  185.         ; Install catalogs
  186.         (copylib
  187.           (prompt   (cat #text_install "toolmanager.catalog"))
  188.           (help     #help_install_languages)
  189.           (source   (tackon #local_IL_source "toolmanager.catalog"))
  190.           (dest     #local_IL_destination)
  191.           (optional force askuser)
  192.           (confirm)
  193.         )
  194.         (copylib
  195.           (prompt   (cat #text_install "toolmanagerprefs.catalog"))
  196.           (help     #help_install_languages)
  197.           (source   (tackon #local_IL_source "toolmanagerprefs.catalog"))
  198.           (dest     #local_IL_destination)
  199.           (optional force askuser)
  200.           (confirm)
  201.         )
  202.       )
  203.       (
  204.         ; Install AmigaGuide document
  205.         (copyfiles
  206.           (prompt   (cat #text_install "ToolManager.guide"))
  207.           (help     #help_install_guides)
  208.           (source   (tackon #local_IL_source "ToolManager.guide"))
  209.           (dest     #local_IL_destination)
  210.           (files)
  211.           (optional force askuser)
  212.           (confirm)
  213.         )
  214.       )
  215.     )
  216.   )
  217. )
  218. ;-----------------------------------------------------------------------------
  219. ;
  220. ; Dynamically create an options menu for languages
  221. ;
  222. ; Inputs: path    (string)   Path to scan for language directories
  223. ;         dest    (string)   Destination path
  224. ;         type    (integer)  Type of installation
  225. ;         prompt  (string)   Prompt text
  226. ;         help    (string)   Help text
  227. ;         helpdir (string)   Help text for directory selection
  228. ;
  229. (procedure P_LanguageChoices #arg_LC_path #arg_LC_dest #arg_LC_type #arg_LC_prompt #arg_LC_help #arg_LC_helpdir
  230.   (
  231.     ; Make sure the destination directory is OK for the user
  232.     (set #arg_LC_dest
  233.       (askdir
  234.         (prompt  #arg_LC_prompt)
  235.         (help    #arg_LC_helpdir)
  236.         (default #arg_LC_dest)
  237.       )
  238.     )
  239.  
  240.     ; We have to use environment variables, because "symbolvar" doesn't work
  241.     (set #local_LC_envname   "ENV:TM_language%ld")
  242.  
  243.     ; Scan for all language directories in the specified path
  244.     (set #local_LC_default   -1)
  245.     (set #local_LC_languages 0)
  246.     (foreach #arg_LC_path "~(#?.info)"
  247.       (
  248.         ; Create environment variable which contains the language name
  249.         (textfile
  250.           (dest (#local_LC_envname #local_LC_languages))
  251.           (append @each-name)
  252.           (safe)
  253.         )
  254.  
  255.         ; Store the index of the default language
  256.         (if (= @each-name @language) (set #local_LC_default #local_LC_languages))
  257.  
  258.         ; Next language
  259.         (set #local_LC_languages (+ #local_LC_languages 1))
  260.       )
  261.     )
  262.     (debug "Number of languages in" #arg_LC_path ":" #local_LC_languages)
  263.  
  264.     ; Round up number of languages to a multiple of 8
  265.     ; Create empty environment variables for padding
  266.     (set #local_LC_choice    #local_LC_languages)
  267.     (set #local_LC_languages (* (/ (+ #local_LC_languages 7) 8) 8))
  268.     (while (< #local_LC_choice #local_LC_languages)
  269.       (
  270.         (textfile
  271.           (dest (#local_LC_envname #local_LC_choice))
  272.           (safe)
  273.         )
  274.         (set #local_LC_choice (+ #local_LC_choice 1))
  275.       )
  276.     )
  277.  
  278.     ; Ask user which languages to install (8 per page)
  279.     (set #local_LC_choice 0)
  280.     (while (< #local_LC_choice #local_LC_languages)
  281.       (
  282.         ; Default language on this page? Set bit mask
  283.         (if (AND (>= #local_LC_default #local_LC_choice)
  284.                  (<  #local_LC_default (+ #local_LC_choice 8)))
  285.           (set #local_LC_mask (shiftleft 1 (- #local_LC_default #local_LC_choice)))
  286.           (set #local_LC_mask 0)
  287.         )
  288.  
  289.         ; Ask user
  290.         (set #local_LC_mask
  291.           (askoptions
  292.             (prompt  #arg_LC_prompt)
  293.             (help    #arg_LC_help)
  294.             (default #local_LC_mask)
  295.             (choices
  296.               (cat "\x1b[2p" (getenv (#local_LC_envname #local_LC_choice)))
  297.               (getenv (#local_LC_envname (+ #local_LC_choice 1)))
  298.               (getenv (#local_LC_envname (+ #local_LC_choice 2)))
  299.               (getenv (#local_LC_envname (+ #local_LC_choice 3)))
  300.               (getenv (#local_LC_envname (+ #local_LC_choice 4)))
  301.               (getenv (#local_LC_envname (+ #local_LC_choice 5)))
  302.               (getenv (#local_LC_envname (+ #local_LC_choice 6)))
  303.               (getenv (#local_LC_envname (+ #local_LC_choice 7)))
  304.             )
  305.           )
  306.         )
  307.  
  308.         ; Next 8 languages
  309.         (set #local_LC_i      #local_LC_choice)
  310.         (set #local_LC_choice (+ #local_LC_choice 8))
  311.  
  312.         ; Call procedure to do the actual copying
  313.         (while (< #local_LC_i #local_LC_choice)
  314.           (
  315.             ; Current language selected?
  316.             (if (IN #local_LC_mask 0)
  317.               (
  318.                 ; Call installation routine with language as parameter
  319.                 (P_InstallLanguage
  320.                   #arg_LC_path
  321.                   #arg_LC_dest
  322.                   (getenv (#local_LC_envname #local_LC_i))
  323.                   #arg_LC_type
  324.                 )
  325.               )
  326.             )
  327.  
  328.             ; Next language
  329.             (set #local_LC_i    (+ #local_LC_i 1))
  330.             (set #local_LC_mask (shiftright #local_LC_mask 1))
  331.           )
  332.         )
  333.       )
  334.     )
  335.  
  336.     ; Delete environment variables again
  337.     (delete "ENV:TM_language#?" (safe))
  338.   )
  339. )
  340. ;-----------------------------------------------------------------------------
  341. ;
  342. ; Install language dependent files
  343. ;
  344. ; No Inputs
  345. ;
  346. (procedure P_CheckLibraries
  347.   (
  348.     ; Check for required libraries
  349.     (set #local_CL_i 0)
  350.     (while
  351.  
  352.       ; Get next library name
  353.       (set #local_CL_library_name
  354.         (select #local_CL_i "LIBS:toolmanager.library"
  355.                             "LIBS:dospath.library"
  356.                             "MUI:Libs/mui/Listtree.mcc"
  357.                             "MUI:Libs/mui/Pophotkey.mcc"
  358.                             "MUI:Libs/mui/Popport.mcc"
  359.                             "MUI:Libs/mui/Popposition.mcc"
  360.                             ""
  361.         )
  362.       )
  363.       (
  364.         ; Get required minimum version (0 matches any version)
  365.         (set #local_CL_library_minversion
  366.           (select #local_CL_i 4
  367.                               0
  368.                               17
  369.                               0
  370.                               0
  371.                               0
  372.           )
  373.         )
  374.         (debug "Checking library" #local_CL_library_name
  375.                " version " #local_CL_library_minversion)
  376.  
  377.         ; Set error flag
  378.         (set #local_CL_error 1)
  379.  
  380.         ; First check that the library exits
  381.         (if (exists #local_CL_library_name)
  382.  
  383.           ; Then check the minimum version
  384.           (if (>= (/ (getversion #local_CL_library_name) 65536)
  385.                   #local_CL_library_minversion)
  386.  
  387.             ; All OK reset error flag
  388.             (set #local_CL_error 0)
  389.           )
  390.         )
  391.  
  392.         ; Error flag set?
  393.         (if #local_CL_error
  394.           (abort #text_check_header  #local_CL_library_name
  395.                  #text_check_version #local_CL_library_minversion
  396.                  #text_check_footer
  397.           )
  398.         )
  399.  
  400.         (set #local_CL_i (+ #local_CL_i 1))
  401.       )
  402.     )
  403.   )
  404. )
  405. ;-----------------------------------------------------------------------------
  406. ;
  407. ; Main "entry" point
  408. ;
  409. ; Initialize locale
  410. (P_InitLocale)
  411. (onerror (P_Cleanup))
  412.  
  413. ; Check installer version (we need at least 43.3)
  414. (if (>= @installer-version (+ 3 (* 43 65536)))
  415.   (
  416.     ; Our own welcome message first...
  417.     (message #text_welcome (all))
  418.  
  419.     ; Now let the user decide how to perform the installation
  420.     (welcome)
  421.     (complete 0)
  422.  
  423.     ; Remove old ToolManager 2.x
  424.     (if (= 1 (exists "LIBS:toolmanager.library"))
  425.       (
  426.         (if (askbool
  427.               (prompt  #text_old_toolmanager)
  428.               (help    #help_old_toolmanager)
  429.               (default 1)
  430.             )
  431.           (
  432.             (working #text_stop_old)
  433.             (run "SYS:WBStartup/ToolManager")
  434.           )
  435.         )
  436.       )
  437.     )
  438.     ; Make sure that the old library is removed from the memory
  439.     (run "Avail flush")
  440.     (complete 10)
  441.  
  442.     ; Install new library
  443.     (copylib
  444.       (prompt   #text_install_library)
  445.       (help     #help_install_library)
  446.       (source   "/Libs/toolmanager.library")
  447.       (dest     "LIBS:")
  448.       (optional force askuser)
  449.       (confirm)
  450.     )
  451.     (complete 20)
  452.  
  453.     ; Install new preferences editor
  454.     (copyfiles
  455.       (prompt     #text_install_prefs)
  456.       (help       #help_install_prefs)
  457.       (source     "/Prefs/ToolManager")
  458.       (dest       "SYS:Prefs")
  459.       (files)
  460.       (optional   force askuser)
  461.       (confirm)
  462.       (infos)
  463.       (noposition)
  464.     )
  465.     (complete 30)
  466.  
  467.     ; Install new starter
  468.     (copyfiles
  469.       (prompt     #text_install_starter)
  470.       (help       #help_install_starter)
  471.       (source     "/WBStartup/ToolManager")
  472.       (dest       "SYS:WBStartup")
  473.       (files)
  474.       (optional   force askuser)
  475.       (confirm)
  476.       (infos)
  477.       (noposition)
  478.     )
  479.     (complete 40)
  480.  
  481.     ; Install languages
  482.     (if (= 2 (exists "/Locale" (noreq)))
  483.       (
  484.         (if (askbool
  485.               (prompt  #text_ask_languages)
  486.               (help    #help_ask_languages)
  487.               (default 1)
  488.             )
  489.           (
  490.             (P_LanguageChoices
  491.               "/Locale/Catalogs"
  492.               "LOCALE:Catalogs"
  493.               0
  494.               #text_install_languages
  495.               #help_install_languages
  496.               #help_install_langdir
  497.             )
  498.           )
  499.         )
  500.       )
  501.     )
  502.     (complete 50)
  503.  
  504.     ; Install AmigaGuide help files
  505.     (if (askbool
  506.           (prompt  #text_ask_guides)
  507.           (help    #help_ask_guides)
  508.           (default 1)
  509.         )
  510.       (
  511.         (P_LanguageChoices
  512.           "/Help"
  513.           "HELP:"
  514.           1
  515.           #text_install_guides
  516.           #help_install_guides
  517.           #help_install_guidedir
  518.         )
  519.         (if (askbool
  520.               (prompt  #text_read_guides)
  521.               (help    #help_read_guides)
  522.               (default 1)
  523.             )
  524.           (
  525.             (working #text_reading_guides)
  526.             (run (cat "SYS:Utilities/MultiView HELP:" @language "/ToolManager.guide"))
  527.           )
  528.         )
  529.       )
  530.     )
  531.     (complete 55)
  532.  
  533.     ; Install additional packages
  534.     (if (= 1 (exists "/Readme.Extras" (noreq)))
  535.       (
  536.         (if (askbool
  537.               (prompt  #text_ask_extras)
  538.               (help    #help_ask_extras)
  539.               (default 1)
  540.             )
  541.           (
  542.             (copylib
  543.               (prompt   #text_extras_stefanb)
  544.               (help     #help_extras_stefanb)
  545.               (source   "/Libs/dospath.library")
  546.               (dest     "LIBS:")
  547.               (optional force askuser)
  548.               (confirm)
  549.             )
  550.             (copylib
  551.               (prompt   #text_extras_stefanb)
  552.               (help     #help_extras_stefanb)
  553.               (source   "/Libs/wbstart.library")
  554.               (dest     "LIBS:")
  555.               (optional force askuser)
  556.               (confirm)
  557.             )
  558.             (copylib
  559.               (prompt   #text_extras_kmel)
  560.               (help     #help_extras_kmel)
  561.               (source   "/Libs/MUI/Pophotkey.mcc")
  562.               (dest     "MUI:Libs/mui")
  563.               (optional force askuser)
  564.               (confirm)
  565.             )
  566.             (copylib
  567.               (prompt   #text_extras_kmel)
  568.               (help     #help_extras_kmel)
  569.               (source   "/Libs/MUI/Popport.mcc")
  570.               (dest     "MUI:Libs/mui")
  571.               (optional force askuser)
  572.               (confirm)
  573.             )
  574.             (copylib
  575.               (prompt   #text_extras_kmel)
  576.               (help     #help_extras_kmel)
  577.               (source   "/Libs/MUI/Popposition.mcc")
  578.               (dest     "MUI:Libs/mui")
  579.               (optional force askuser)
  580.               (confirm)
  581.             )
  582.           )
  583.         )
  584.       )
  585.     )
  586.     (complete 60)
  587.  
  588.     ; Check that all needed libraries are installed
  589.     (P_CheckLibraries)
  590.     (complete 65)
  591.  
  592.     ; Convert old configuration
  593.     (if (= 1 (exists "ENVARC:ToolManager.prefs"))
  594.       (
  595.         (if (askbool
  596.               (prompt  #text_convert)
  597.               (help    #help_convert)
  598.               (default 1)
  599.             )
  600.           (
  601.             (working #text_converting)
  602.             (run "/Prefs/Converter >CON:0/0/640/100/Converter/CLOSE/WAIT")
  603.             (run "Copy ENVARC:ToolManager.prefs ENV:")
  604.           )
  605.         )
  606.       )
  607.     )
  608.     (complete 70)
  609.  
  610.     ; Show disclaimer
  611.     (working #text_disclaimer)
  612.     (run "SYS:Utilities/Multiview /Disclaimer" (safe))
  613.     (complete 80)
  614.  
  615.     ; Start new ToolManager
  616.     (if (askbool
  617.           (prompt  #text_start_new)
  618.           (help    #help_start_new)
  619.           (default 1)
  620.         )
  621.       (
  622.         (working #text_starting_new)
  623.         (run "SYS:WBStartup/ToolManager")
  624.         (complete 90)
  625.  
  626.         ; Start demo for new users
  627.         (if (= 0 (exists "ENV:ToolManager.prefs"))
  628.           (
  629.             (if (askbool
  630.                   (prompt  #text_start_demo)
  631.                   (help    #help_start_demo)
  632.                   (default 1)
  633.                 )
  634.               (
  635.                 (working #text_starting_demo)
  636.                 (run "Copy /Demo.prefs ENV:ToolManager.prefs")
  637.                 (message #text_stop_demo (all))
  638.                 (run "delete ENV:ToolManager.prefs")
  639.               )
  640.             )
  641.           )
  642.         )
  643.         (complete 95)
  644.       )
  645.     )
  646.  
  647.     ; We made it...
  648.     (complete 100)
  649.     (exit #text_complete (quiet))
  650.   )
  651.   (
  652.     (abort #text_installer)
  653.   )
  654. )
  655. ;-----------------------------------------------------------------------------
  656.